/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 *
 * @author Thomas
 */
import java.util.ArrayList;
import cs1.Keyboard;
public class playerObject extends combatObject{
    int level, experience;
    public playerObject(String N, String D, combatData stats){
        super(N, D, stats);
    }
    //Create new Character.
    public playerObject(){
        super(null, null, null);
        System.out.println("Pick a name:");
        Name = Keyboard.readString();
        String Description;
        System.out.println("Write a short description:");
        Description = Keyboard.readString();
        Params = new combatData();
        skills = new ArrayList<ability>();
    }
    public void addSkill(ability skill){
        skills.add(skill);
    }
    public int getLevel(){
        return level;
    }
    public int getExperience(){
        return experience;
    }
    public void printNHpMP(){
        System.out.println(Name + "\n" + "Level: " + level);
        Params.printHP();
        Params.printMP();
    }
    public void act(ArrayList<combatObject> Friends, ArrayList<combatObject> Enemies){
        if (!isAlive())
            return;
        for(int i = 0; i < skills.size(); i++){
            System.out.println((i + 1) + ".)" + skills.get(i).getName()+ "\n    " +
                    skills.get(i).getDesc());
        }
        int choice = 0;
        boolean failsafe = true;
        choice = Keyboard.readInt();
        while(failsafe){
            if(choice > skills.size() || choice <= 0){
                System.out.println("Index out of bounds.");
                choice = Keyboard.readInt();
                failsafe = true;
            }else
                failsafe = false;
        }
        skills.get(choice - 1).effect(this, Friends, Enemies);
        
        
    }
            
    
}
